Skip to content

Add more docs and a clean integration example publisher.#29

Open
sgillen wants to merge 8 commits intomainfrom
sgillen/agent_md
Open

Add more docs and a clean integration example publisher.#29
sgillen wants to merge 8 commits intomainfrom
sgillen/agent_md

Conversation

@sgillen
Copy link
Collaborator

@sgillen sgillen commented Feb 16, 2026

Adds a new architecture doc, a clean example on how to integrate greenwave diagnostics inline, and a small Agents.md file.

@greptile-apps
Copy link

greptile-apps bot commented Feb 16, 2026

Greptile Summary

This PR adds a comprehensive DESIGN_AND_IMPLEMENTATION.md architecture guide, a clean inline-diagnostics example publisher node (ExampleGreenwavePublisherNode), and an AGENTS.md file for AI coding assistant guidelines. Documentation previously spread across README.md and docs/images/SERVICES.md is consolidated into the new design doc.

  • New ExampleGreenwavePublisherNode demonstrates inline GreenwaveDiagnostics integration: publishes sensor_msgs/Imu at a configurable frequency with explicit diagnostics publishing on a 1 Hz timer. Includes header, implementation, main entry point, and gtest.
  • docs/DESIGN_AND_IMPLEMENTATION.md provides end-to-end architecture documentation: design goals, component overview, step-by-step inline integration guide, diagnostics contract, service API reference, and latency measurement notes.
  • README.md slimmed down by moving implementation details to the new design doc; dashboard references updated from r2s_gw to ncurses_dashboard.
  • docs/images/SERVICES.md deleted — content relocated to the design doc.
  • AGENTS.md added with project structure, build commands, coding style, and PR guidelines for AI assistants.
  • CMakeLists.txt updated with build target and gtest for the new example node.

Confidence Score: 4/5

  • This PR is safe to merge — it adds documentation and a self-contained example node with tests, without modifying any existing runtime code.
  • The PR is additive: new documentation, a new example node, and corresponding tests. No existing production code is modified. The C++ example follows established patterns from the existing minimal_publisher_node. The only code changes to existing files are documentation updates in README.md, examples/README.md, and example.launch.py. Minor style observations exist but nothing that would affect correctness.
  • No files require special attention. All new code follows existing patterns in the codebase.

Important Files Changed

Filename Overview
AGENTS.md New file providing AI coding assistant guidelines: project structure, build commands, coding style, testing, and commit conventions. Straightforward documentation, no issues.
README.md Moved detailed diagnostics/latency documentation to DESIGN_AND_IMPLEMENTATION.md, added reference to inline integration example node, updated dashboard references from r2s_gw to ncurses. No issues.
docs/DESIGN_AND_IMPLEMENTATION.md Comprehensive new architecture/integration guide consolidating design, inline diagnostics integration steps, service API docs, and latency measurement details. Well-structured and accurate.
docs/images/SERVICES.md Deleted file — service API documentation was relocated to DESIGN_AND_IMPLEMENTATION.md. No content lost.
greenwave_monitor/CMakeLists.txt Adds build target for example_greenwave_publisher_node and its gtest. Follows same patterns as the existing minimal_publisher_node targets. No issues.
greenwave_monitor/examples/README.md Updated dashboard reference from r2s_gw to ncurses_dashboard and added pointer to the new inline integration example node. No issues.
greenwave_monitor/examples/example.launch.py Updated LogInfo message to reference ncurses_dashboard instead of r2s_gw. No issues.
greenwave_monitor/include/example_greenwave_publisher_node.hpp New header for example publisher node. Clean class design with explicit destructor that cancels timers and resets diagnostics before base Node teardown. Follows existing patterns.
greenwave_monitor/src/example_greenwave_publisher_main.cpp Standard ROS 2 main() entry point — init, create node, spin, shutdown. Mirrors existing minimal_publisher_main.cpp pattern exactly.
greenwave_monitor/src/example_greenwave_publisher_node.cpp Clean inline-diagnostics example node publishing sensor_msgs/Imu at configurable frequency with explicit GreenwaveDiagnostics integration. Code is correct and well-structured.
greenwave_monitor/test/test_example_greenwave_publisher.cpp Unit tests for the example publisher: validates default parameters and end-to-end message publishing with custom parameters. Uses improved rclcpp::ok() guard compared to existing tests.

Sequence Diagram

sequenceDiagram
    participant Main as example_greenwave_publisher_main
    participant Node as ExampleGreenwavePublisherNode
    participant GWDiag as GreenwaveDiagnostics
    participant PubIMU as IMU Publisher
    participant PubDiag as /diagnostics Publisher
    participant Dashboard as ncurses_dashboard

    Main->>Node: construct(options)
    Node->>Node: declare_parameter("topic", "frequency_hz")
    Node->>PubIMU: create_publisher(/example_imu)
    Node->>GWDiag: construct(node, topic, config)
    GWDiag->>PubDiag: create_publisher(/diagnostics)
    Node->>Node: create_wall_timer(publish_message, 1/freq)
    Node->>Node: create_wall_timer(publish_diagnostics, 1s)

    loop Every 1/frequency_hz seconds
        Node->>PubIMU: publish(Imu msg)
        Node->>GWDiag: updateDiagnostics(stamp_ns)
        GWDiag->>GWDiag: track interarrival, latency
    end

    loop Every 1 second
        Node->>GWDiag: publishDiagnostics()
        GWDiag->>PubDiag: publish(DiagnosticArray)
        PubDiag-->>Dashboard: /diagnostics topic
    end
Loading

Last reviewed commit: 1ba32e9

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@sgillen sgillen changed the title Docs + Agent.md Add more docs and a clean integration example publisher. Feb 19, 2026
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments